<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Album Details</f:facet>


        <s:decorate id="created" template="layout/display.xhtml">
            <ui:define name="label">Created</ui:define>
            <h:outputText value="#{albumHome.instance.created}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="description" template="layout/display.xhtml">
            <ui:define name="label">Description</ui:define>
            <h:outputText value="#{albumHome.instance.description}"/>
        </s:decorate>

        <s:decorate id="lastupdated" template="layout/display.xhtml">
            <ui:define name="label">Lastupdated</ui:define>
            <h:outputText value="#{albumHome.instance.lastupdated}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="published" template="layout/display.xhtml">
            <ui:define name="label">Published</ui:define>
            <h:outputText value="#{albumHome.instance.published}"/>
        </s:decorate>

        <s:decorate id="title" template="layout/display.xhtml">
            <ui:define name="label">Title</ui:define>
            <h:outputText value="#{albumHome.instance.title}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/AlbumEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty albumFrom ? 'AlbumList' : albumFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Access</h:panelGroup>
        </f:facet>
    <div class="association" id="accessParent">

        <h:outputText value="There is no access associated with this album."
                   rendered="#{albumHome.instance.access == null}"/>

        <rich:dataTable var="_access"
                   value="#{albumHome.instance.access}"
                rendered="#{albumHome.instance.access != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="accessTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_access.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Access</f:facet>
                <h:outputText value="#{_access.access}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Description</f:facet>
                <h:outputText value="#{_access.description}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewaccess"
                     value="View"
                      view="/Access.xhtml">
                    <f:param name="accessId"
                           value="#{_access.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Category</h:panelGroup>
        </f:facet>
    <div class="association" id="categoryParent">

        <h:outputText value="There is no category associated with this album."
                   rendered="#{albumHome.instance.category == null}"/>

        <rich:dataTable var="_category"
                   value="#{albumHome.instance.category}"
                rendered="#{albumHome.instance.category != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="categoryTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_category.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Label</f:facet>
                <h:outputText value="#{_category.label}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Parent id</f:facet>
                <h:outputText value="#{_category.parent.id}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewcategory"
                     value="View"
                      view="/Category.xhtml">
                    <f:param name="categoryId"
                           value="#{_category.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Owner</h:panelGroup>
        </f:facet>
    <div class="association" id="ownerParent">

        <h:outputText value="There is no owner associated with this album."
                   rendered="#{albumHome.instance.owner == null}"/>

        <rich:dataTable var="_user"
                   value="#{albumHome.instance.owner}"
                rendered="#{albumHome.instance.owner != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="ownerTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_user.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Dsc</f:facet>
                <h:outputText value="#{_user.dsc}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_user.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Firstname</f:facet>
                <h:outputText value="#{_user.firstname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Lastloggedin</f:facet>
                <h:outputText value="#{_user.lastloggedin}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Lastname</f:facet>
                <h:outputText value="#{_user.lastname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Password</f:facet>
                <h:outputText value="#{_user.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Registered</f:facet>
                <h:outputText value="#{_user.registered}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Role id</f:facet>
                <h:outputText value="#{_user.role.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status id</f:facet>
                <h:outputText value="#{_user.status.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Username</f:facet>
                <h:outputText value="#{_user.username}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewuser"
                     value="View"
                      view="/User.xhtml">
                    <f:param name="userId"
                           value="#{_user.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
